Hi Claude, thanks a lot for the reply!!!
I already had tried that way you show, without the constructor, simply: var config = Config()
Same thing! So I moved to the implicit init construct. Well in my code I have a function that output to another struct (Instrumentation) such:
func getInstrumentation() -> Instrumentation {
var instrumentation: STInstrumentation
/* do some simple stuff here like declare other vars
... put the need values to function and one of that information is, eg., isVirtualMachine, but this data comes from the Config
.... so it will crash right here whatever use/call it do >>> */
if config.isVirtualMachine { do something } // will crash here if this is the 1st line
instrumentation.isVirtualMachine = config.isVirtualMachine // **this is the actual line in my code where it crashes:(**
}
That "if config" is just an example, the real code uses the line below, the only way I had to search for this error was doing that, as in my computer it won't raise any error and I cant make remote debug (I don't even know if Swift does that). I am telling that line crashes but any attempt to read any of the config properties will make it fail.
EDIT: I made a change and sent to the client to him a try (waiting for the answer), I change the function declaration to func getInstrumentation(configInformation: STConfig) -> STInstrumentation and now I am passing the config as parameter. Hope it can fix. Anyway fixed or not I really can't understand why with some devices it works.
Topic:
Programming Languages
SubTopic:
Swift
Tags: